package com.zkyc.framework.common.mapper;

import com.zkyc.framework.common.pojo.Right;
import org.apache.ibatis.annotations.Mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * (Right)表数据库访问层
 *
 * @author wj
 * @since 2022-05-25 16:32:10
 */
@Mapper
public interface RightMapper extends BaseMapper<Right> {
    @Select({
            "<script>",
            "SELECT * from system_right a,system_role_ref_right b",
            "where b.role_id=#{roleId}",
            " and a.id=b.right_id",
            " order by a.id",
            "</script>"
    })
    List<Right> getRightListByRoleId(@Param("roleId") Long roleId);


}

